from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_detail, object_list
from django.views.generic.date_based import archive_index, archive_year, archive_month, archive_day, object_detail
from erp.received.models import *

received_date_dict = {
    'queryset': ReceivedItem.objects.all(),
    'date_field': 'created',
    'template_object_name': 'received',
}

urlpatterns = patterns('',
	
	#Blog
	(r'^received/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', object_detail, dict(received_date_dict, slug_field='slug')),
	(r'^received/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$', archive_day, dict(received_date_dict, allow_empty=True)),
	(r'^received/(?P<year>\d{4})/(?P<month>[a-z]{3})/$', archive_month, dict(received_date_dict, allow_empty=True)),
	(r'^received/(?P<year>\d{4})/$', archive_year, dict(received_date_dict, allow_empty=True)),
	
	# Uncomment this for admin:
     (r'^admin/', include('django.contrib.admin.urls')),
	
)